package com.zhx.common.common.util;

import com.zhx.common.common.domain.dto.RequestInfo;

/**
 * 请求上下文
 */
public class RequestHolder {
    private static final ThreadLocal<RequestInfo> requestHolder = new ThreadLocal<>();

    public static void set(RequestInfo requestInfo) {
        // 将请求信息设置到请求持有者中
        requestHolder.set(requestInfo);
    }


    public static RequestInfo get() {
        return requestHolder.get();
    }

    public static void remove() {
        requestHolder.remove();
    }
}
